getAs

inline fun <K, V> Map<K, *>.getAs(key: K, type: Class<out V>, message: Map<K, *>.(K) -> String = { MISSING_KEY }): V(source)
inline fun <K, V> Map<K, *>.getAs(key: K, type: KClass<out V & Any>, message: Map<K, *>.(K) -> String = { MISSING_KEY }): V(source)

Retrieves the value associated with the specified key in the map and casts it to the provided type. If the key is not present, throws a NoSuchElementException with the given message.


inline fun <K, V> Map<K, *>.getAs(key: K, message: Map<K, *>.(K) -> String = { MISSING_KEY }): V(source)

Retrieves the value associated with the specified key in the map and casts it as V. If the key is not present, throws a NoSuchElementException with the given message.